<?php
/**
 * Created by PhpStorm.
 * User: Guangpeng Chen
 * Date: 2014-11-18
 * Time: 10:15
 */

if (!class_exists('ProductInfo')) {
    include 'ProductInfo.php';
}
class ProductInfoExt extends ProductInfo{

    public function jsPrice($did, $date,$p_pid=0){
        $p_pid      = $p_pid>0 ? $p_pid : $this->pid;
        $jsprice    = $this->s->get_Dynamic_Price_Merge($p_pid,$date,1);
        if ( $jsprice==-1 ) {
            return -1;
        }
        $dprice     = $this->dprice($did,$p_pid);
        $jsprice    = $dprice+$jsprice;
        return $jsprice;
    }

    public function uPrice($did,$date,$p_pid=0){
        $p_pid      = $p_pid ? $p_pid : $this->pid;
        $uprice     = $this->s->get_Dynamic_Price_Merge($p_pid,$date,1,"","",1);
        if ($uprice==-1) {
            return -1;
        }
        return $uprice;
    }
} 